clear all;

load('comm_loc.mat');
comm_loc=comm_loc(:,1:11);
loc86=comm_loc(:,1);
loc96=comm_loc(:,11);

sample=find(loc86==0);

n=1e6;
random_sample(1:n,1:431)=0.0;
correction_ratio(1:n)=0.0;
for i=1:n
    random_sample(i,:)=randsample(sample,431);
    correction_ratio(i)=sum(loc96(random_sample(i,:)))/431;
end
save('random.mat','-v7.3')